<template>
	<view>
		<!-- <view class="head">当前资料完整度{{ progress?progress:0 }}%</view> -->

		<view class="box">
			<view class="base">
				<view class="base-title">基本资料</view>
				<view class="base-item" @tap="changeAvatar">
					<view class="item-left">
						<text>头像</text>
					</view>
					<view class="item-right">
						<!-- <image src="https://yc10120.iseo365.com/uploads/20210122/9aa500c143ded8a06c2bbca31c26e8e8.png" mode=""></image> -->
						<image :src="allInfo.avatar" mode=""></image>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>微信号</text>
					</view>
					<view class="item-right">
						<input type="text" v-model="allInfo.wxid" placeholder="请输入" @blur="wxConfirm" @confirm="wxConfirm" />
						<!-- <input type="text" :value="allInfo.wxid" placeholder="请输入" /> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>


				<view class="base-item">
					<view class="item-left">
						<text>微信号是否显示</text>
					</view>
					<view class="item-right">
						<view>
							<picker @change="wxIsShowChange" :value="allInfoIndex.wxIsShow" :range="allList.wxIsShow" range-key="name">
								<view :class="[allInfo.wxIsShow?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.wxIsShow&&allInfo.wxIsShow!==null?allInfo.wxIsShow:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>


				<view class="base-item">
					<view class="item-left">
						<text>真实姓名</text>
						<view class="raw" v-if="underReview.username">审核中</view>
					</view>
					<view class="item-right">
						<!-- <input type="text" :value="allInfo.name" maxlength="20" placeholder="请输入" @blur="nameConfirm" @confirm="nameConfirm" /> -->
						<view v-if="underReview.username" class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.username?underReview.username:allInfo.name }}</view>
						<input type="text" :value="allInfo.username" v-else maxlength="20" placeholder="请输入" @focus="nameFocus" @blur="nameConfirm"
						 @confirm="nameConfirm" />
						<!-- <input type="text" v-else :value="allInfo.name" maxlength="20" placeholder="请输入" /> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>性别</text>
						<view class="raw" v-if="underReview.gender">审核中</view>
					</view>
					<!-- 性别审核 -->
					<view class="item-right" v-if="underReview.gender">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.gender?underReview.gender:allInfo.gender }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<picker @change="genderChange" :value="index" :range="genderArr" :disabled="tipsType[0].status" @tap="tipsJudge(0)">
								<view :class="[allInfo.gender?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.gender&&allInfo.gender!==null?allInfo.gender:'请选择'}}</view>
							</picker>
						</view>
						<view v-else>
							<picker @change="genderChange" :value="index" :range="allList.gender" range-key="name">
								<view :class="[allInfo.gender?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.gender&&allInfo.gender!==null?allInfo.gender:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>出生年月</text>
						<view class="raw" v-if="underReview.birthday">审核中</view>
					</view>
					<!-- 出生年月判断 -->
					<view v-if="underReview.birthday" class="item-right">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.birthday?underReview.birthday:pickerDate }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view v-else class="item-right">
						<gpp-date-picker @onCancel="onCancel" @onConfirm="onConfirm" :counts="canCount" :certification="certification"
						 :isVip="allInfo.isVip" :startDate="startDate" :endDate="endDate">
							<text :class="[pickerDate?'gpp-text':'gpp-texts']">{{pickerDate&&pickerDate!==null?pickerDate:'请选择'}}</text>
						</gpp-date-picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>生肖</text>
						<view class="raw" v-if="underReview.zodiac">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.zodiac">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.zodiac?underReview.zodiac:allInfo.zodiac }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<picker @change="zodiacChange" :value="allInfoIndex.zodiac" :range="allList.zodiac" range-key="name">
							<view :class="[allInfo.zodiac?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.zodiac&&allInfo.zodiac!==null?allInfo.zodiac:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>


				<view class="base-item">
					<view class="item-left">
						<text>星座</text>
						<view class="raw" v-if="underReview.constellation">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.constellation">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.constellation?underReview.constellation:allInfo.constellation }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<picker @change="constellationChange" :value="allInfoIndex.constellation" :range="allList.constellation"
						 range-key="name">
							<view :class="[allInfo.constellation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.constellation&&allInfo.constellation!==null?allInfo.constellation:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<!-- 	<view class="base-item">
					<view class="item-left">
						<text>居住地</text>

						<view class="raw" v-if="underReview.habitation">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.habitation">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.habitation?underReview.habitation:allInfo.habitation }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>

					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<picker @change="areaChange" :value="index" :range="areaArr" :disabled="tipsType[1].status" @tap="tipsJudge(1)">
								<view :class="[allInfo.habitation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.habitation&&allInfo.habitation!==null?allInfo.habitation:'请选择'}}</view>
							</picker>
						</view>
						<view v-else>
							<picker @change="areaChange" :value="index" :range="areaArr">
								<view :class="[allInfo.habitation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.habitation&&allInfo.habitation!==null?allInfo.habitation:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
 -->

				<view class="base-item">
					<view class="item-left">
						<text>居住地</text>
						<view class="raw" v-if="underReview.habitation">审核中</view>
					</view>
					<view class="item-right">
						<pickers @change="areaChange" @address="address" @close="close" :defaultAddress="defaultAddress">
							<view :class="[allInfo.habitation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.habitation&&allInfo.habitation!==null?allInfo.habitation:'请选择'}}</view>
						</pickers>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>


				<view class="base-item">
					<view class="item-left">
						<text>婚姻状态</text>
						<view class="raw" v-if="underReview.maritaldata">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.maritaldata">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.maritaldata?underReview.maritaldata:allInfo.maritaldata }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<picker @change="marryChange" :value="allInfoIndex.maritaldata" :range="allList.maritaldata" range-key="maritaldata">
							<view :class="[allInfo.maritaldata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.maritaldata&&allInfo.maritaldata!==null?allInfo.maritaldata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<!-- <view class="base-item">
					<view class="item-left">
						<text>年龄</text>
					</view>
					<view class="item-right">
						<picker @change="ageChange" :value="index" :range="ageArr">
							<view :class="[allInfo.age?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.age&&allInfo.age!==null?allInfo.age:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view> -->

				<view class="base-item">
					<view class="item-left">
						<text>身高</text>
						<view class="raw" v-if="underReview.heightdata">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.heightdata">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.heightdata?underReview.heightdata+'cm':allInfo.heightdata }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<picker @change="heightChange" :value="allInfoIndex.heightdata" :range="allList.heightdata" :disabled="tipsType[3].status"
							 @tap="tipsJudge(3)">
								<view :class="[allInfo.heightdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.heightdata&&allInfo.heightdata!==null?allInfo.heightdata:'请选择'}}</view>
							</picker>
						</view>
						<view v-else>
							<picker @change="heightChange" :value="heightValue" :range="heightArr">
								<view :class="[allInfo.heightdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.heightdata&&allInfo.heightdata!==null?allInfo.heightdata:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>体重</text>
					</view>
					<view class="item-right">
						<picker @change="weightChange" :value="allInfoIndex.weightdata" :range="weightArr">
							<view :class="[allInfo.weightdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.weightdata&&allInfo.weightdata!==null?allInfo.weightdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>学历</text>
						<view class="raw" v-if="underReview.educationaldata">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.educationaldata">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.educationaldata?underReview.educationaldata:allInfo.educationaldata }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<picker @change="collageChange" :value="index" :range="educationArr" :disabled="tipsType[4].status" @tap="tipsJudge(4)">
								<view :class="[allInfo.educationaldata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.educationaldata&&allInfo.educationaldata!==null?allInfo.educationaldata:'请选择'}}</view>
							</picker>
						</view>
						<view v-else>
							<picker @change="collageChange" :value="allInfoIndex.educationaldata" :range="allList.educationaldata" range-key="educationaldata">
								<view :class="[allInfo.educationaldata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.educationaldata&&allInfo.educationaldata!==null?allInfo.educationaldata:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<!-- 民族 -->
				<!-- <view class="base-item">
					<view class="item-left">
						<text>民族</text>
						<view class="raw" v-if="underReview.nation">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.nation">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.nation?underReview.nation:allInfo.nation }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<picker @change="nationChange" :value="index" :range="nationArr" :disabled="tipsType[5].status" @tap="tipsJudge(5)">
								<view :class="[allInfo.nation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.nation&&allInfo.nation!==null?allInfo.nation:'请选择'}}</view>
							</picker>
						</view>
						<view v-else>
							<picker @change="nationChange" :value="index" :range="nationArr">
								<view :class="[allInfo.nation?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.nation&&allInfo.nation!==null?allInfo.nation:'请选择'}}</view>
							</picker>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view> -->

				<!-- 籍贯 -->
				<!-- <view class="base-item">
					<view class="item-left">
						<text>籍贯</text>
						<view class="raw" v-if="underReview.province">审核中</view>
					</view>
					<view class="item-right" v-if="underReview.province">
						<view class="uni-input" style="font-size: 28rpx;padding: 10rpx 20rpx;" @tap="doCount()">{{ underReview.province?underReview.province:allInfo.province+'-'+allInfo.city+'-'+allInfo.county }}</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
					<view class="item-right" v-else>
						<view v-if="allInfo.isVip&&certification==1">
							<pickers @address="address" @close="close" :defaultAddress="defaultAddress" :disabled="tipsType[6].status" @tap="tipsJudge(6)">
								<view :class="[allInfo.province?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.province&&allInfo.province!==null?allInfo.province+'-'+allInfo.city+'-'+allInfo.county:'请选择'}}</view>
							</pickers>
						</view>
						<view v-else>
							<pickers @address="address" @close="close" :defaultAddress="defaultAddress">
								<view :class="[allInfo.province?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.province&&allInfo.province!==null?allInfo.province+'-'+allInfo.city+'-'+allInfo.county:'请选择'}}</view>
							</pickers>
						</view>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>-->
				<!-- 月收入 -->
				<view class="base-item">
					<view class="item-left">
						<text>月收入</text>
					</view>
					<view class="item-right">
						<picker @change="incomeChange" :value="allInfoIndex.incomedata" :range="allList.income" range-key="income">
							<view :class="[allInfo.incomedata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.incomedata&&allInfo.incomedata!==null?allInfo.incomedata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<!-- 购车情况 -->
				<view class="base-item">
					<view class="item-left">
						<text>购车情况</text>
					</view>
					<view class="item-right">
						<picker @change="carChange" :value="allInfoIndex.cardata" :range="allList.cardata" range-key="cardata">
							<view :class="[allInfo.cardata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.cardata&&allInfo.cardata!==null?allInfo.cardata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<!-- 购房情况 -->
				<view class="base-item">
					<view class="item-left">
						<text>购房情况</text>
					</view>
					<view class="item-right">
						<picker @change="houseChange" :value="allInfoIndex.housedata" :range="allList.housedata" range-key="housedata">
							<view :class="[allInfo.housedata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.housedata&&allInfo.housedata!==null?allInfo.housedata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				<view class="base-item">
					<view class="item-left">
						<text>工作行业</text>
					</view>
					<view class="item-right">
						<picker @change="workChange" :value="allInfoIndex.industry" :range="allList.industry" range-key="name">
							<view :class="[allInfo.industry?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.industry&&allInfo.industry!==null?allInfo.industry:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				<view class="base-item">
					<view class="item-left">
						<text>厨艺{{allInfo.cookingdata}}</text>
					</view>
					<view class="item-right">
						<picker @change="cookChange" :value="allInfoIndex.cookingdata" :range="allList.cookingdata" range-key="cookingdata">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.cookingdata&&allInfo.cookingdata!==null?allInfo.cookingdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				<view class="base-item">
					<view class="item-left">
						<text>性格</text>
					</view>
					<view class="item-right" @click="popUp" style="overflow: hidden;">
						<view :class="[upInfo.character?'uni-input':'uni-inputr']" style="font-size: 28rpx;overflow: hidden;margin-right: 20rpx;">
							{{upInfo.character?upInfo.character:'请选择'}}
						</view>

						<!-- <picker @change="characterChange" :value="allInfoIndex.character" :range="allList.character" range-key="cookingdata" mode="multiSelector">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.character&&allInfo.character!==null?allInfo.character:'请选择'}}</view>
						</picker> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>


				<view class="base-item">
					<view class="item-left">
						<text>是否在群里</text>
					</view>
					<view class="item-right">
						<picker @change="is_groupChange" :value="allInfoIndex.is_group" :range="allList.is_group" range-key='name'>
							<view :class="[allInfo.is_group?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.is_group&&allInfo.is_group!==null?allInfo.is_group:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>




				<view class="base-item">
					<view class="item-left">
						<text>爱情宣言</text>
					</view>
					<view class="item-right" style="overflow: hidden;">
						<!-- <input type="text" v-model="upInfo.declaration" placeholder="请输入" /> -->
						<textarea style="font-size: 28rpx;text-align: right;margin-right: 10rpx;" v-model="upInfo.declaration" auto-height placeholder="请输入" placeholder-style="font-size:28rpx;" />
						<!-- <picker @change="characterChange" :value="allInfoIndex.character" :range="allList.character" range-key="cookingdata" mode="multiSelector">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.character&&allInfo.character!==null?allInfo.character:'请选择'}}</view>
						</picker> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
			</view>

			<uni-cus-drawer :classname="'active500'" ref="drawer" v-on:onHide="onHideDrawer">
				<!-- 可以是自定义组件-->
				<view style="display: flex;">
					<view style="display: flex; flex-wrap: wrap;flex:1;overflow-y:auto;">
						<view v-for="(item, index) in allList.character" style="margin-right: 20rpx;display: flex;">
							<uni-tag :text="item.name" @click="bindClickTag(index)" style="margin:2px;" :type="item.type==1?'default':'primary'"></uni-tag>
						</view>
					</view>
				</view>
			</uni-cus-drawer>

			<!-- 			<view class="base">
				<view class="base-title">其他资料</view>
				 -->
			<!-- 工作行业 -->
			<!-- <view class="base-item">
					<view class="item-left">
						<text>工作行业</text>
					</view>
					<view class="item-right">
						<picker @change="workChange" :value="index" :range="workArr">
							<view :class="[allInfo.industry?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.industry&&allInfo.industry!==null?allInfo.industry:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view> -->

			<!-- </view> -->

			<!-- 			<view class="base">
				<view class="base-title">生活习惯</view> -->
			<!-- 				<view class="base-item">
					<view class="item-left">
						<text>是否抽烟</text>
					</view>
					<view class="item-right">
						<picker @change="smokeChange" :value="index" :range="smokeArr">
							<view :class="[allInfo.smokingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.smokingdata&&allInfo.smokingdata!==null?allInfo.smokingdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view> -->
			<!-- 
				<view class="base-item">
					<view class="item-left">
						<text>是否喝酒</text>
					</view>
					<view class="item-right">
						<picker @change="drinkChange" :value="index" :range="drinkArr">
							<view :class="[allInfo.drinkingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.drinkingdata&&allInfo.drinkingdata!==null?allInfo.drinkingdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>是否锻炼</text>
					</view>
					<view class="item-right">
						<picker @change="exerciseChange" :value="index" :range="exerciseArr">
							<view :class="[allInfo.exercisedata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.exercisedata&&allInfo.exercisedata!==null?allInfo.exercisedata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>宠物情况</text>
					</view>
					<view class="item-right">
						<picker @change="petChange" :value="index" :range="petArr">
							<view :class="[allInfo.petsdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.petsdata&&allInfo.petsdata!==null?allInfo.petsdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

				<view class="base-item">
					<view class="item-left">
						<text>厨艺</text>
					</view>
					<view class="item-right">
						<picker @change="cookChange" :value="index" :range="cookArr">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.cookingdata&&allInfo.cookingdata!==null?allInfo.cookingdata:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>

			</view> -->
			
			<view class="base">
				<view class="base-title">择偶要求</view>
				
				<view class="base-item">
					<view class="item-left">
						<text>接受年龄</text>
					</view>
					<view class="item-right">
						<input type="digit" v-model="upInfo.is_age" placeholder="请输入" />
			<!-- 			<picker @change="is_ageChange" :value="allInfoIndex.is_age" :range="allList.age" range-key='age'>
							<view :class="[allInfo.is_age?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.is_age&&allInfo.is_age!==null?allInfo.is_age:'请选择'}}</view>
						</picker> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				
				<view class="base-item">
					<view class="item-left">
						<text>是否接受离婚</text>
					</view>
					<view class="item-right">
						<picker @change="is_divorceChange" :value="allInfoIndex.is_divorce" :range="allList.is_divorce" range-key='name'>
							<view :class="[allInfo.is_divorce?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.is_divorce&&allInfo.is_divorce!==null?allInfo.is_divorce:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				<view v-if="upInfo.is_divorce==1"  class="base-item">
					<view class="item-left">
						<text>是否接受小孩</text>
					</view>
					<view class="item-right">
						<picker @change="is_kidsChange" :value="allInfoIndex.is_kids" :range="allList.is_kids" range-key='name'>
							<view :class="[allInfo.is_kids?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.is_kids&&allInfo.is_kids!==null?allInfo.is_kids:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				
				<view v-if="upInfo.is_divorce==1 && (upInfo.is_kids==1||upInfo.is_kids==2||upInfo.is_kids==3)"  class="base-item">
					<view class="item-left">
						<text>小孩跟谁一起生活</text>
					</view>
					<view class="item-right">
						<picker @change="kids_liveChange" :value="allInfoIndex.kids_live" :range="allList.kids_live" range-key='name'>
							<view :class="[allInfo.kids_live?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.kids_live&&allInfo.kids_live!==null?allInfo.kids_live:'请选择'}}</view>
						</picker>
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				
				
				
				<view class="base-item">
					<view class="item-left">
						<text>彩礼</text>
					</view>
					<view class="item-right" style="overflow: hidden;">
						<input type="digit" v-model="upInfo.betrothal_gifts" placeholder="请输入" />
						<!-- <picker @change="characterChange" :value="allInfoIndex.character" :range="allList.character" range-key="cookingdata" mode="multiSelector">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.character&&allInfo.character!==null?allInfo.character:'请选择'}}</view>
						</picker> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				<view class="base-item">
					<view class="item-left">
						<text>择偶要求补充</text>
					</view>
					<view class="item-right" style="overflow: hidden;">
						<textarea v-model="upInfo.content" style="font-size: 28rpx;text-align: right;margin-right: 10rpx;"  auto-height placeholder="择偶要求补充" placeholder-style="font-size:28rpx;"/>
						<!-- <picker @change="characterChange" :value="allInfoIndex.character" :range="allList.character" range-key="cookingdata" mode="multiSelector">
							<view :class="[allInfo.cookingdata?'uni-input':'uni-inputr']" style="font-size: 28rpx;padding: 10rpx 20rpx;">{{allInfo.character&&allInfo.character!==null?allInfo.character:'请选择'}}</view>
						</picker> -->
						<i class="iconfont iconicon_gengduo icon" style="font-size: 24rpx;color: #999999;"></i>
					</view>
				</view>
				
				
				

			</view>



			<view class="place"></view>

			<view class="btn-box"  style="z-index: 99;">
				<view class="btn" @tap="doBtn()">提交</view>
			</view>

		</view>

		<!-- 页面提示框 -->
		<view :class="[serviseShow?'masker':'maskers']" class="mask" v-if="maskShow">
			<view class="servise">
				<view class="servise-title">
					系统提示
				</view>
				<view class="servise-content">
					点击下方【继续】按钮即代表您承诺填写的资料完全属实，如有虚假您将承担由此引起的一切相关责任。平台注重保护用户的个人隐私，您的资料仅限用于征婚使用。
				</view>
				<view class="servise-btn">
					<text class="btn-cancel" @tap="changeItem(0)">取消</text>
					<text class="btn-agree" @tap="changeItem(1)">继续</text>
				</view>
			</view>

		</view>



	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex'
	import pickers from "@/components/ming-picker/ming-picker.vue"
	import {
		arrData
	} from '@/common/arr';
	import gppDatePicker from "@/components/gpp-datePicker/gpp-datePicker.vue"
	export default {
		components: {
			gppDatePicker,
			pickers,
		},
		data() {
			return {
				isShowBottom: false,
				//记录已点击的项
				tipsIndex: null,
				tipsType: [{
						name: 'gender',
						status: true
					},
					{
						name: 'habitation',
						status: true
					},
					{
						name: 'maritaldata',
						status: true
					},
					{
						name: 'heightdata',
						status: true
					},
					{
						name: 'educationaldata',
						name: 'heightdata',
						status: true
					},
					{
						name: 'nation',
						status: true
					},
					{
						name: 'province',
						status: true
					},
				],
				index: 0,
				maskShow: false,
				serviseShow: false,
				titleList: [],
				title: '更新成功!',
				//身高默认值
				heightValue: [20],
				//体重默认值
				weightValue: [25],
				//择偶身高默认值
				selectHeightValue: [20, 20],
				//审核中
				underReview: {
					username: '',
					gender: '',
					province: '',
					birthday: '',
					habitation: '',
					heightdata: '',
					nation: '',
					educationaldata: '',
					maritaldata: ''
				},
				//周期内修改
				certification: '',
				//已经上传过的次数
				count: null,
				//可提交的次数
				canCount: '',
				//顶部进度条
				progress: '',
				//默认选中
				defaultAddress: ["江苏省", "无锡市", "梁溪区"],
				allList: {},
				//日期选择
				startDate: "1960-01-01",
				endDate: "2030-01-01",
				pickerDate: '',
				//性别选择
				genderArr: [],
				//居住地
				areaArr: [],
				//婚姻状况
				marryArr: [],
				//年龄
				ageArr: [],
				// 生肖
				zodiacArr: [],
				constellationArr: [],
				//身高
				heightArr: [],
				//体重
				weightArr: [],
				//学历
				educationArr: [],
				//月收入
				incomeArr: [],
				//购车
				carArr: [],
				//购房
				houseArr: [],
				//民族
				nationArr: [],
				//工作
				workArr: [],
				//抽烟
				smokeArr: [],
				//喝酒
				drinkArr: [],
				//锻炼
				exerciseArr: [],
				//宠物
				petArr: [],
				//厨艺
				cookArr: [],
				//择偶-身高
				selectHeightArr: [],
				//择偶年龄
				selectAgeArr: [],
				//择偶体重
				selectWeightArr: [],
				//择偶学历
				selectEducationArr: [],
				//显示info
				ttest: 'fdfd',
				allInfoIndex: {
					maritaldataIndex: 0,
					heightdata: 0,
					weightdata: 0,
					gender: 0,
					zodiac: 0,
					constellation: 0,
					educationaldata: 0,
					incomedata: 0,
					cardata: 0,
					housedata: 0,
					industry: 0,
					cookingdata: 0,
					wxIsShow: 0,
					is_age: '',
					is_divorce: '',
					is_group: '',
					betrothal_gifts:'',
					is_kids: '',
					kids_live: '',
				},
				allInfo: {
					avatar: '',
					wxid: '',
					name: '',
					gender: '',
					habitation: '',
					maritaldata: '',
					// age: '',
					heightdata: '',
					weightdata: '',
					educationaldata: '',
					incomedata: '',
					cardata: '',
					housedata: '',
					nation: '',
					province: '',
					city: '',
					county: '',
					industry: '',
					smokingdata: '',
					drinkingdata: '',
					exercisedata: '',
					petsdata: '',
					cookingdata: '',
					selectionheightdata: '',
					selectionage: '',
					selectionweightdata: '',
					selectioneducationaldata: '',
					selectionincomedata: '',
					selectioncounty: '',
					selectionmaritaldata: '',
					tags: [],
					wxIsShow: '',
					declaration: "",
					is_age: '',
					is_divorce: '',
					is_group: '',
					betrothal_gifts:'',
					is_kids: '',
					kids_live: '',
				},
				//上传info
				upInfo: {
					character: '',
					declaration: '',
					is_age: '',
					content:'',
					is_divorce: '1',
					is_group: '1',
					betrothal_gifts:'',
					is_kids: '1',
					kids_live: '',
					wxis_show:1,
					username: '',
					birthday: '1990-01-01',
					avatar: '',
					zodiac: '1',
					constellation: '1',
					occupation: '1',
					income: '1',
					gender: '1',
					character: '1',
					height: '165',
					address: '',
				},
				u: {},
			};
		},
		computed: {
			...mapState(['token']),

		},
		onLoad() {
			console.log(this.token);
			let ustr = uni.getStorageSync('userinfo')
			this.u = JSON.parse(ustr)
			//获取数据
			this.getData();
			this.getInfo();

			this.doAnimation();
		},
		methods: {
			popUp() {
				// this.$refs['pop'].show()
				this.$refs.drawer.open();
			},
			bindClickTag(index) {
				let tag = this.allList.character[index].name
				// console.log(this.allInfo.tags);
				let i = this.allInfo.tags.findIndex((item) => {
					return tag == item
				})
				if (i == -1) {
					this.allList.character[index].type = 2
					this.allInfo.tags.push(tag)
				} else {
					this.allList.character[index].type = 1
					this.allInfo.tags.splice(i, 1);
				}
				this.upInfo.character = this.allInfo.tags.join(',')
			},
			tipsJudge(e) {
				console.log(e);
				console.log(this.tipsIndex);
				console.log(this.allInfo.isVip)
				console.log(this.certification)

				//防止点击的不是同一个
				if (this.tipsIndex !== e) {
					for (let i in this.tipsType) {
						if (this.tipsType[i]) {
							this.tipsType[i].status = true;
						}
					}
				}

				//判断状态值是否为真，弹出提示框  修改状态
				if (this.tipsType[e].status) {
					uni.showModal({
						title: '温馨提醒',
						content: '您已是实名认证会员。修改真实姓名、性别、出生年月、居住地、婚姻状态、身高、学历、名族、籍贯基本资料需要再次审核，您还可以提交审核【' + this.canCount +
							'】次。提交修改上述之外的资料无需再次审核，也不占用提交审核的次数限制。',
						showCancel: false,
						confirmText: '知道了',
						success: (res) => {
							console.log(res);
							this.tipsType[e].status = false;
							this.tipsIndex = e;
							console.log(this.tipsType[e].status)
						}
					});
				} else {
					console.log(this.tipsType[e].status)
				}
			},
			closeBottom() {
				this.isShowBottom = !this.isShowBottom
			},
			//点击确认或取消
			changeItem(e) {
				if (e == 0) {
					//点击了取消
					try {
						uni.setStorageSync('userPrivacy', '');
						uni.navigateBack();
					} catch (e) {
						// error
					}
				} else {
					uni.setStorage({
						key: 'userPrivacy',
						data: 1,
						success: () => {
							console.log('success');
						}
					});
					//确认
					this.serviseShow = false;
					setTimeout(() => {
						this.maskShow = false;
					}, 500)
				}

			},
			//提示框动画
			doAnimation() {
				try {
					const value = uni.getStorageSync('userPrivacy');
					console.log('进入值:' + value);
					if (!value) {
						this.maskShow = true;
						this.serviseShow = true;
					}
				} catch (e) {
					// error
					console.log(e)
				}
			},
			doCount() {
				return
				if (this.count == 3 && this.certification == 1) {
					//不可修改
					uni.showModal({
						title: '温馨提示',
						content: '实名认证会员，年度周期内仅能修改3次!',
						confirmText: '知道了',
						showCancel: false,
						success: (res) => {
							console.log(res);
						}
					})
				} else {
					console.log(111);
				}
			},
			//点击保存
			doBtn() {
				this.upInfo.id = this.u.id
				this.upInfo.cook_list = ['无']
				uni.showLoading({
					title: '正在提交...'
				})
				this.doResult();
				// this.doJudge();
				// setTimeout(() => {
				// 	uni.hideLoading();
				// 	this.doResult();
				// }, 1000)
			},
			//提示判断
			doJudge() {
				//审核状态
				if (this.certification == 1) {
					// this.title = '更新成功,部分资料需要审核!';

					let arr = [...this.titleList];
					console.log(arr);
					for (let i in arr) {
						let value = arr[i];
						// console.log(str);
						switch (value) {
							case 'username':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'gender':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'birthday':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'habitation':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'maritaldata':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'heightdata':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'educationaldata':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							case 'nation':
								// console.log(str);
								this.title = '更新成功,部分资料需要审核!';
								break;
							default:
								this.title = '更新成功!';
						}
					}

				} else {
					//非审核状态
					this.title = '更新成功';
				}
			},
			//执行上传
			async doResult() {
				try {
					let parmars = {
						token: this.token,
						...this.upInfo
					};
					let res = await this.$request.request.post('/api/user/info', parmars)
					if (res.code == 200) {
						uni.showToast({
							title: "提交成功",
							icon: 'none',
							duration: 1000,
							mask: true
						});
						this.getInfo();
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000,
							mask: true
						});
					}
				} catch (err) {
					this.$request.error(err, this)
				}
				uni.hideLoading();
			},
			//获取信息数据
			async getInfo() {
				try {
					let parmars = {
						token: uni.getStorageSync('token'),
						id: this.u.id,
					};
					let res = await this.$request.request.get('/api/index/info', parmars);
					if (res.code) {
						let user = res.data.data;
						if (!user) {
							return
						}
						this.upInfo = {
							id: 6,
							username: user.username,
							birthday: user.birthday,
							avatar: user.avatar,
							zodiac: user.zodiac,
							constellation: user.constellation,
							occupation: user.occupation,
							income: user.income,
							gender: user.gender,
							character: user.character,
							height: user.height,
							address: user.address,
							wxis_show: user.wxis_show,
							cook_list: ["无"],
							declaration: user.declaration,
							is_age: user.is_age,
							is_divorce: user.is_divorce,
							is_group: user.is_group,
							betrothal_gifts: user.betrothal_gifts,
							is_kids: user.is_kids,
							kids_live: user.kids_live,
							content:user.content,
						}
						let tags = user.character.split(',')
						let itemIndex = {
							maritaldataIndex: user ? user.marry : 0,
							heightdata: this.findIndexOne(this.heightArr, user.height + 'cm'),
							weightdata: this.findIndexOne(this.weightArr, user.weight + 'kg'),
							gender: this.findIndexId(this.allList.gender, user.gender),
							zodiac: this.findIndexId(this.allList.zodiac, user.zodiac),
							constellation: this.findIndexId(this.allList.constellation, user.constellation),
							educationaldata: this.findIndexId(this.allList.educationaldata, user.education),
							incomedata: this.findIndexId(this.allList.income, user.income),
							cardata: this.findIndexId(this.allList.cardata, user.is_car),
							housedata: this.findIndexId(this.allList.housedata, user.house),
							industry: this.findIndexId(this.allList.industry, user.occupation),
							cookingdata: this.findIndexId(this.allList.cookingdata, user.is_cook),
							character: this.findIndexIdArr(this.allList.character, tags),
							wxIsShow: this.findIndexId(this.allList.wxIsShow, user.wxis_show),
							// is_age: this.findIndexId(this.allList.age, user.is_age),
							is_divorce: this.findIndexId(this.allList.is_divorce, user.is_divorce),
							is_group: this.findIndexId(this.allList.is_group, user.is_group),
							is_kids: this.findIndexId(this.allList.is_kids, user.is_kids),
							kids_live: this.findIndexId(this.allList.kids_live, user.kids_live),
						}
						// console.log(2222,itemIndex.industry)
						let item = {
							avatar: user.avatar,
							wxid: user.wx,
							wxIsShow: this.allList.wxIsShow[itemIndex.wxIsShow].name,
							username: user.username,
							zodiac: this.allList.zodiac[itemIndex.zodiac].name,
							gender: this.allList.gender[itemIndex.gender].name,
							habitation: user.address,
							maritaldata: this.marryArr[itemIndex.maritaldataIndex],
							constellation: this.allList.constellation[itemIndex.constellation].name,
							// age: '',
							heightdata: user.height,
							weightdata: user.weight,
							educationaldata: this.allList.educationaldata[itemIndex.educationaldata].educationaldata,
							incomedata: this.allList.income[itemIndex.incomedata].income,
							cardata: this.allList.cardata[itemIndex.cardata].cardata,
							housedata: this.allList.housedata[itemIndex.housedata].housedata,
							// character:this.allList.character[itemIndex.character].character,
							nation: '',
							province: '',
							city: '',
							county: '',
							address: user.address,
							industry: this.allList.industry[itemIndex.industry].name,
							smokingdata: '',
							drinkingdata: '',
							exercisedata: '',
							petsdata: '',
							cookingdata: this.allList.cookingdata[itemIndex.cookingdata].cookingdata,
							selectionheightdata: '',
							selectionage: '',
							selectionweightdata: '',
							selectioneducationaldata: '',
							selectionincomedata: '',
							selectioncounty: '',
							selectionmaritaldata: '',
							tags: tags,
							is_age: user.is_age,
							is_divorce: this.allList.is_divorce[itemIndex.is_divorce].name,
							is_group: this.allList.is_group[itemIndex.is_group].name,
							betrothal_gifts: user.betrothal_gifts,
							is_kids: this.allList.is_kids[itemIndex.is_kids].name,
							kids_live: this.allList.kids_live[itemIndex.kids_live].name,
						}

						this.allInfoIndex = itemIndex;
						this.allInfo = item;

						this.allInfo.heightdata ? this.allInfo.heightdata += 'cm' : '';
						this.allInfo.weightdata ? this.allInfo.weightdata += 'kg' : '';
						//判断是否实名认证
						// this.certification = res.data.info.certification;

						if (res.data.data.birthday || res.data.data.birthday !== null) {
							this.pickerDate = res.data.data.birthday;
						}
						if (user.address || user.address !== null) {
							let arr = user.address.split(',')
							if (arr) {
								this.defaultAddress = arr
							}
						}
						//执行计算完成度
						// this.result();

						//计算是否在审核中
						// this.doRaw(res.data.check);

						//设置总修改次数
						this.count = res.data.count;

						//设置可上传次数
						this.canCount = res.data.canCount;

						//重新赋值部分择偶条件
						// if (this.allInfo.selectionheightdata) {
						// 	let arr = this.allInfo.selectionheightdata.split('-');
						// 	this.allInfo.selectionheightdata = arr[0] + 'cm' + '-' + arr[1] + 'cm';
						// }
						// if (this.allInfo.selectionage) {
						// 	let arr = this.allInfo.selectionage.split('-');
						// 	this.allInfo.selectionage = arr[0] + '岁' + '-' + arr[1] + '岁';
						// }
						// if (this.allInfo.selectionweightdata) {
						// 	let arr = this.allInfo.selectionweightdata.split('-');
						// 	this.allInfo.selectionweightdata = arr[0] + 'kg' + '-' + arr[1] + 'kg';
						// }


					}
				} catch (err) {
					this.$request.error(err, this)
				}
			},


			findIndexIdArr(arr, valueArr) {
				if (!valueArr) {
					return
				}
				for (let i in valueArr) {
					let ii = this.findIndexValue(arr, valueArr[i])
					this.allList.character[ii].type = 2
				}
			},
			findIndexValue(arr, value) {
				let index = arr.findIndex((item) => {
					return value == item.name
				})
				return index > 0 ? index : 0;
			},
			findIndexId(arr, id) {
				let index = arr.findIndex((item) => {
					return id == item.id
				})
				return index > 0 ? index : 0;
			},
			findIndexOne(arr, one) {
				let index = arr.findIndex((item) => {
					return one == item
				})
				return index > 0 ? index : 0;
			},
			//计算是否在审核中
			doRaw(e) {
				console.log(43434, e);
				let arr = [...e];
				let obj = {};
				console.log(arr);
				for (let i in arr) {

					if (arr[i].field == 'province') {
						obj.province = arr[i].after
					} else if (arr[i].field == 'county') {
						obj.county = arr[i].after
					} else if (arr[i].field == 'city') {
						obj.city = arr[i].after
					}


					let value = arr[i].field;
					let str = arr[i].after;
					// console.log(str);
					switch (value) {
						case 'username':
							// console.log(str);
							this.underReview.username = str;
							break;
						case 'gender':
							// console.log(str);
							this.underReview.gender = str;
							break;
						case 'birthday':
							// console.log(str);
							this.underReview.birthday = str;
							break;
						case 'habitation':
							// console.log(str);
							this.underReview.habitation = str;
							break;
						case 'maritaldata':
							// console.log(str);
							this.underReview.maritaldata = str;
							break;
						case 'heightdata':
							// console.log(str);
							this.underReview.heightdata = str;
							break;
						case 'educationaldata':
							// console.log(str);
							this.underReview.educationaldata = str;
							break;
						case 'nation':
							// console.log(str);
							this.underReview.nation = str;
							break;
					}
				}

				if (obj.province && obj.county && obj.city) {
					//直接拼接
					this.underReview.province = obj.province + '-' + obj.county + '-' + obj.city
				} else {
					if (obj.province) {
						this.underReview.province = obj.province + '-' + this.allInfo.city + '-' + this.allInfo.county;
					} else if (obj.county) {
						this.underReview.province = this.allInfo.province + '-' + this.allInfo.city + '-' + obj.county;
					} else if (obj.city) {
						this.underReview.province = this.allInfo.province + '-' + obj.city + '-' + this.allInfo.county;
					}
				}


				console.log(this.underReview.province);

			},
			//计算完成度
			result() {
				let arr = [];
				let arr2 = [];

				for (let i in this.allInfo) {
					arr2.push(this.allInfo[i]);
					if (this.allInfo[i]) {
						arr.push(this.allInfo[i])
					}
				}
				let num = Number(arr.length);
				let num2 = Number(arr2.length);

				this.progress = parseInt(num / num2 * 100);
				console.log('完成度:' + this.progress)
			},
			//获取所有数据
			getData() {
				let res = arrData;
				console.log(8989, arrData);
				this.allList = { ...arrData
				};
				this.init();
			},
			//上传头像
			changeAvatar() {
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: (chooseImageRes) => {
						const tempFilePaths = chooseImageRes.tempFilePaths;
						// console.log(JSON.stringify(chooseImageRes.tempFilePaths));
						uni.uploadFile({
							url: this.$config.API + '/api/common/upload',
							header: {
								'token': this.token
							},
							filePath: tempFilePaths[0],
							name: 'file',
							success: (uploadFileRes) => {
								let res = JSON.parse(uploadFileRes.data);
								console.log(res);
								if (res.code == 1) {
									uni.showToast({
										title: res.msg,
										icon: "none",
										mask: true
									});
									console.log(this.allInfo);
									//赋值本地头像
									this.allInfo.avatar = res.data.fullurl;
									this.upInfo.avatar = res.data.fullurl;
								} else {
									uni.showToast({
										title: res.msg,
										icon: "none",
										mask: true
									});
								}
							}
						});
					}
				});
			},
			//微信号
			wxConfirm(e) {
				// console.log(e);
				this.allInfo.wxid = e.detail.value;
				this.upInfo.wx = this.allInfo.wxid;
			},
			//真实姓名
			nameFocus(e) {
				return
				if (this.allInfo.isVip && this.certification == 1) {
					uni.showModal({
						title: '温馨提醒',
						content: '您已是实名认证会员。修改真实姓名、性别、出生年月、居住地、婚姻状态、身高、学历、名族、籍贯基本资料需要再次审核，您还可以提交审核【' + this.canCount +
							'】次。提交修改上述之外的资料无需再次审核，也不占用提交审核的次数限制。',
						showCancel: false,
						confirmText: '知道了',
						success: (res) => {
							console.log(res);
						}
					});
				}
			},
			nameConfirm(e) {
				let name;
				this.allInfo.name = e.detail.value;
				this.upInfo.username = this.allInfo.name;
				this.titleList.push(name);
			},
			//省市区
			address(e) {
				let province;
				let city;
				let county;
				this.allInfo.province = e.value[0];
				this.allInfo.city = e.value[1];
				this.allInfo.county = e.value[2];
				// this.upInfo.province = e.value[0];
				// this.upInfo.city = e.value[1];
				// this.upInfo.county = e.value[2];
				this.upInfo.address = e.value.join(',');
				this.allInfo.habitation = this.upInfo.address
				this.titleList.push(province);
				this.titleList.push(city);
				this.titleList.push(county);
			},
			//省市区
			close() {
				console.log("点击了取消")
			},
			//重置数组
			init() {
				// 星座 constellation
				for (let i in this.allList.constellation) {
					if (this.allList.constellation[i].name) {
						this.constellationArr.push(this.allList.constellation[i].name)
					}
				}

				// 生肖
				for (let i in this.allList.zodiac) {
					if (this.allList.zodiac[i].name) {
						this.zodiacArr.push(this.allList.zodiac[i].name)
					}
				}
				//性别数组
				for (let i in this.allList.gender) {
					if (this.allList.gender[i].name) {
						this.genderArr.push(this.allList.gender[i].name)
					}
				}

				//居住地
				for (let i in this.allList.area) {
					if (this.allList.area[i].shortname) {
						this.areaArr.push(this.allList.area[i].shortname)
					}
				}

				//婚姻状况
				for (let i in this.allList.maritaldata) {
					if (this.allList.maritaldata[i].maritaldata) {
						this.marryArr.push(this.allList.maritaldata[i].maritaldata)
					}
				}

				// 身高数组
				for (let i = 150; i <= 210; i++) {
					if (i) {
						this.heightArr.push(i + 'cm')
					}
				}

				// 体重数组
				for (let i = 35; i <= 120; i++) {
					if (i) {
						this.weightArr.push(i + 'kg')
					}
				}

				//年龄数组
				for (let i = 18; i <= 70; i++) {
					if (i) {
						this.ageArr.push(i + '岁')
					}
				}
				//学历数组
				for (let i in this.allList.educationaldata) {
					if (this.allList.educationaldata[i].educationaldata) {
						this.educationArr.push(this.allList.educationaldata[i].educationaldata)
					}
				}

				//月收入数组
				for (let i in this.allList.income) {
					if (this.allList.income[i].income) {
						this.incomeArr.push(this.allList.income[i].income)
					}
				}

				//购车
				for (let i in this.allList.cardata) {
					if (this.allList.cardata[i].cardata) {
						this.carArr.push(this.allList.cardata[i].cardata)
					}
				}

				//购房
				for (let i in this.allList.housedata) {
					if (this.allList.housedata[i].housedata) {
						this.houseArr.push(this.allList.housedata[i].housedata)
					}
				}

				//民族
				for (let i in this.allList.nation) {
					if (this.allList.nation[i].nation) {
						this.nationArr.push(this.allList.nation[i].nation)
					}
				}

				//工作
				for (let i in this.allList.industry) {
					if (this.allList.industry[i].name) {
						this.workArr.push(this.allList.industry[i].name)
					}
				}
				// 抽烟
				for (let i in this.allList.smokingdata) {
					if (this.allList.smokingdata[i].smokingdata) {
						this.smokeArr.push(this.allList.smokingdata[i].smokingdata)
					}
				}

				//喝酒
				for (let i in this.allList.drinkingdata) {
					if (this.allList.drinkingdata[i].drinkingdata) {
						this.drinkArr.push(this.allList.drinkingdata[i].drinkingdata)
					}
				}

				//锻炼
				for (let i in this.allList.exercisedata) {
					if (this.allList.exercisedata[i].exercisedata) {
						this.exerciseArr.push(this.allList.exercisedata[i].exercisedata)
					}
				}

				//宠物
				for (let i in this.allList.petsdata) {
					if (this.allList.petsdata[i].petsdata) {
						this.petArr.push(this.allList.petsdata[i].petsdata)
					}
				}

				//厨艺
				for (let i in this.allList.cookingdata) {
					if (this.allList.cookingdata[i].cookingdata) {
						this.cookArr.push(this.allList.cookingdata[i].cookingdata)
					}
				}
				//择偶身高
				this.selectHeightArr = [
					[...this.heightArr],
					[...this.heightArr]
				];

				//择偶年龄
				this.selectAgeArr = [
					[...this.ageArr],
					[...this.ageArr]
				];

				//择偶体重
				this.selectWeightArr = [
					[...this.weightArr],
					[...this.weightArr]
				];
			},
			wxIsShowChange(e) {
				let index = e.target.value;
				this.allInfo.wxIsShow = this.allList.wxIsShow[index].name;
				console.log(this.allInfo.wxIsShow);
				//上传数据更新
				this.upInfo.wxis_show = this.allList.wxIsShow[index].id;
			},
			//性别
			genderChange(e) {
				if (this.allInfo.isVip && this.certification == 1) {
					uni.showModal({
						title: '温馨提醒',
						content: '您已是实名认证会员。修改真实姓名、性别、出生年月、居住地、婚姻状态、身高、学历、名族、籍贯基本资料需要再次审核，您还可以提交审核【' + this.canCount +
							'】次。提交修改上述之外的资料无需再次审核，也不占用提交审核的次数限制。',
						showCancel: false,
						confirmText: '知道了',
						success: (res) => {
							console.log(res);
						}
					});
				}
				let gender;
				let index = e.target.value;
				this.allInfo.gender = this.genderArr[index];
				//上传数据更新
				this.upInfo.gender = this.allList.gender[index].gender;
				this.titleList.push(gender);
			},
			//出生年月
			onCancel(e) {
				console.log(e);
			},
			onConfirm(e) {
				let birthday;
				this.pickerDate = e.dateValue;
				this.upInfo.birthday = e.dateValue;
				this.titleList.push(birthday);
			},
			is_ageChange(e) {
				let index = e.target.value;
				this.allInfo.is_age = this.allList.age[index].age;
				this.allInfoIndex.is_age = index;
				this.upInfo.is_age = this.allList.age[index].id;
			},
			is_divorceChange(e) {
				let index = e.target.value;
				this.allInfo.is_divorce = this.allList.is_divorce[index].name;
				this.allInfoIndex.is_divorce = index;
				this.upInfo.is_divorce = this.allList.is_divorce[index].id;
			},
			is_groupChange(e) {
				let index = e.target.value;
				this.allInfo.is_group = this.allList.is_group[index].name;
				this.allInfoIndex.is_group = index;
				this.upInfo.is_group = this.allList.is_group[index].id;
			},
			is_kidsChange(e) {
				let index = e.target.value;
				this.allInfo.is_kids = this.allList.is_kids[index].name;
				this.allInfoIndex.is_kids = index;
				this.upInfo.is_kids = this.allList.is_kids[index].id;
			},
			kids_liveChange(e) {
				let index = e.target.value;
				this.allInfo.kids_live = this.allList.kids_live[index].name;
				this.allInfoIndex.kids_live = index;
				this.upInfo.kids_live = this.allList.kids_live[index].id;
			},
			//居住地
			areaChange(e) {
				let habitation;
				let index = e.target.value;
				this.allInfo.habitation = this.areaArr[index];
				//上传数据更新
				this.upInfo.address = this.allList.area[index].id;
				this.titleList.push(habitation);
			},
			zodiacChange(e) {
				let zodiac;
				let index = e.target.value;
				this.allInfo.zodiac = this.allList.zodiac[index].name;
				this.allInfoIndex.zodiac = this.allList.zodiac[index].id;
				//上传数据更新
				this.upInfo.zodiac = this.allList.zodiac[index].id;
				this.titleList.push(zodiac);
			},
			constellationChange(e) {
				let constellation;
				let index = e.target.value;
				this.allInfo.constellation = this.allList.constellation[index].name;
				this.allInfoIndex.constellation = this.allList.constellation[index].id;
				//上传数据更新
				this.upInfo.constellation = this.allList.constellation[index].id;
				this.titleList.push(constellation);
			},
			//婚姻状况
			marryChange(e) {
				let maritaldata;
				let index = e.target.value;
				this.allInfo.maritaldata = this.allList.maritaldata[index].maritaldata;
				this.allInfoIndex.maritaldata = this.allList.maritaldata[index].id;
				//上传数据更新
				this.upInfo.marry = this.allList.maritaldata[index].id;
				this.titleList.push(maritaldata);
			},
			//年龄
			// ageChange(e) {
			// 	let reg = /[\u4E00-\u9FA5]/g;
			// 	let index = e.target.value;
			// 	this.allInfo.age = this.ageArr[index];
			// 	this.upInfo.age = this.ageArr[index].replace(reg, '');
			// },
			//身高
			heightChange(e) {
				let heightdata;
				let index = e.target.value;
				console.log(this.heightArr[index]);
				this.allInfo.heightdata = this.heightArr[index];
				this.allInfoIndex.heightdata = this.heightArr[index];
				//上传数据更新
				this.upInfo.height = this.heightArr[index].substring(0, this.heightArr[index].length - 2);
				this.titleList.push(heightdata);
			},
			//体重
			weightChange(e) {
				let index = e.target.value;
				this.allInfo.weightdata = this.weightArr[index];
				this.allInfoIndex.weightdata = this.weightArr[index];
				//上传数据更新
				this.upInfo.weight = this.weightArr[index].substring(0, this.weightArr[index].length - 2);
			},
			//学历
			collageChange(e) {
				let educationaldata;
				let index = e.target.value;
				this.allInfo.educationaldata = this.allList.educationaldata[index].educationaldata;
				this.allInfoIndex.educationaldata = this.allList.educationaldata[index].id;
				//上传数据更新
				this.upInfo.education = this.allList.educationaldata[index].id;
				this.titleList.push(educationaldata);
			},
			//月收入
			incomeChange(e) {
				let index = e.target.value;
				this.allInfo.incomedata = this.allList.income[index].income;
				this.allInfoIndex.incomedata = this.allList.income[index].id;
				//上传数据更新
				this.upInfo.income = this.allList.income[index].id;
			},
			//购车
			carChange(e) {
				let index = e.target.value;
				this.allInfo.cardata = this.allList.cardata[index].cardata;
				this.allInfoIndex.cardata = this.allList.cardata[index].id;
				//上传数据更新
				this.upInfo.is_car = this.allList.cardata[index].id;
			},
			//购房
			houseChange(e) {
				let index = e.target.value;
				this.allInfo.housedata = this.houseArr[index];
				this.allInfoIndex.housedata = this.allList.housedata[index].id;
				//上传数据更新
				this.upInfo.house = this.allList.housedata[index].id;
			},
			//民族
			nationChange(e) {
				let nation;
				let index = e.target.value;
				this.allInfo.nation = this.nationArr[index];
				//上传数据更新
				this.upInfo.nation = this.allList.nation[index].id;
				this.titleList.push(nation);
			},
			//工作
			workChange(e) {
				let index = e.target.value;
				this.allInfo.industry = this.workArr[index];
				this.allInfoIndex.industry = this.allList.industry[index].id;
				//上传数据更新
				this.upInfo.occupation = this.allList.industry[index].id;
			},
			//抽烟
			smokeChange(e) {
				let index = e.target.value;
				this.allInfo.smokingdata = this.smokeArr[index];
				//上传数据更新
				this.upInfo.smokingdata = this.allList.smokingdata[index].id;
			},
			//喝酒
			drinkChange(e) {
				let index = e.target.value;
				this.allInfo.drinkingdata = this.drinkArr[index];
				//上传数据更新
				this.upInfo.drinkingdata = this.allList.drinkingdata[index].id;
			},
			//锻炼
			exerciseChange(e) {
				let index = e.target.value;
				this.allInfo.exercisedata = this.exerciseArr[index];
				//上传数据更新
				this.upInfo.exercisedata = this.allList.exercisedata[index].id;
			},
			//宠物
			petChange(e) {
				let index = e.target.value;
				this.allInfo.petsdata = this.petArr[index];
				//上传数据更新
				this.upInfo.petsdata = this.allList.petsdata[index].id;
			},
			//厨艺
			cookChange(e) {
				let index = e.target.value;
				this.allInfo.cookingdata = this.cookArr[index];
				this.allInfoIndex.cookingdata = this.allList.cookingdata[index].id;
				//上传数据更新
				this.upInfo.is_cook = this.allList.cookingdata[index].id;
			},
			//择偶身高
			selectHeightChange(e) {
				console.log(e);
				//进行区间判断
				let num1 = e.target.value[0];
				let num2 = e.target.value[1];
				if (num1 <= num2) {
					//正常显示
					this.allInfo.selectionheightdata = this.selectHeightArr[0][num1] + '-' + this.selectHeightArr[1][num2];
					this.upInfo.selectionheightdata = this.selectHeightArr[0][num1].substring(0, this.selectHeightArr[0][num1].length -
						2) + '-' + this.selectHeightArr[1][num2].substring(0, this.selectHeightArr[0][num1].length - 2);
				} else {
					//交换顺序
					this.allInfo.selectionheightdata = this.selectHeightArr[1][num2] + '-' + this.selectHeightArr[0][num1];
					this.upInfo.selectionheightdata = this.selectHeightArr[1][num2].substring(0, this.selectHeightArr[0][num1].length -
						2) + '-' + this.selectHeightArr[0][num1].substring(0, this.selectHeightArr[0][num1].length - 2);
				}
			},
			//择偶年龄
			selectAgeChange(e) {
				let reg = /[\u4E00-\u9FA5]/g;
				// console.log(e);
				//进行区间判断
				let num1 = e.target.value[0];
				let num2 = e.target.value[1];
				if (num1 <= num2) {
					//正常显示
					this.allInfo.selectionage = this.selectAgeArr[0][num1] + '-' + this.selectAgeArr[1][num2];
					this.upInfo.selectionage = this.selectAgeArr[0][num1].replace(reg, '') + '-' + this.selectAgeArr[1][num2].replace(
						reg, '');
				} else {
					//交换顺序
					this.allInfo.selectionage = this.selectAgeArr[1][num2] + '-' + this.selectAgeArr[0][num1];
					this.upInfo.selectionage = this.selectAgeArr[1][num2].replace(reg, '') + '-' + this.selectAgeArr[0][num1].replace(
						reg, '');
				}
			},
			//择偶体重
			selectWeightChange(e) {
				// console.log(e);
				//进行区间判断
				let num1 = e.target.value[0];
				let num2 = e.target.value[1];
				if (num1 <= num2) {
					//正常显示
					this.allInfo.selectionweightdata = this.selectWeightArr[0][num1] + '-' + this.selectWeightArr[1][num2];
					this.upInfo.selectionweightdata = this.selectWeightArr[0][num1].substring(0, this.selectWeightArr[0][num1].length -
						2) + '-' + this.selectWeightArr[1][num2].substring(0, this.selectWeightArr[1][num2].length - 2);
				} else {
					//交换顺序
					this.allInfo.selectionweightdata = this.selectWeightArr[1][num2] + '-' + this.selectWeightArr[0][num1];
					this.upInfo.selectionweightdata = this.selectWeightArr[1][num2].substring(0, this.selectWeightArr[1][num2].length -
						2) + '-' + this.selectWeightArr[0][num1].substring(0, this.selectWeightArr[0][num1].length - 2);
				}
			},
			//择偶学历
			selectEducationChange(e) {
				let index = e.target.value;
				this.allInfo.selectioneducationaldata = this.educationArr[index];
				//上传数据更新
				this.upInfo.selectioneducationaldata = this.allList.educationaldata[index].id;
			},
			//择偶收入
			selectionIncomeChange(e) {
				let index = e.target.value;
				this.allInfo.selectionincomedata = this.incomeArr[index];
				//上传数据更新
				this.upInfo.selectionincomedata = this.allList.income[index].id;
			},
			//择偶居住地
			// selectionCountyChange(e) {
			// 	let index = e.target.value;
			// 	this.allInfo.selectioncounty = this.areaArr[index];
			// 	this.upInfo.selectioncounty = this.allList.area[index].id;
			// },
			//择偶婚姻
			selectionMaryChange(e) {
				let index = e.target.value;
				this.allInfo.selectionmaritaldata = this.marryArr[index];
				//上传数据更新
				this.upInfo.selectionmaritaldata = this.allList.maritaldata[index].id;
			}
		}
	}
</script>

<style lang="scss">
	@import'baseInfo.scss'
</style>
